<?php
  require_once('tpl/header.php');
?>

   <?php 
	//接收userlist传递的uid参数，
	//连接数据库写sql语句去删除用户记录
	// mysql_connect("localhost","root","");
	// mysql_select_db("neuvideo");
	// mysql_set_charset("utf8");

	require("inc_admin.php");
	connect();


	$tid=$_GET["tid"];
	$sql0="select * from videotype where tid=$tid";
	$result0=mysql_query($sql0);
	// var_dump($result0);
	$num0=mysql_num_rows($result0);
	// var_dump($result0);
	if ($num0==0) {
			$sql="delete from videotype where tid=$tid";
			$num=mysql_query($sql);
			if ($num>0) {
				echo "视频类型删除成功,2秒后跳转到列表页";
				header("refresh:2;url=typeList.php");
			}
			else{
				echo "视频类型删除失败,2秒后跳转到列表页";
				header("refresh:2;typeList.php");
			}
		}
		else{
			echo "该类型中还有视频，不能删除该类型";
			header("refresh:2;typeList.php");
		}
		?>


<?php
  require_once('tpl/footer.php');
?>